﻿@model IEnumerable<Century.Model.CMS.SitePage>
@{
    int cnt = 1;
    string cssclass = "menuMainHeader";
    string linkCss = "menuMainHeaderLink";
    string menuBoardCss = string.Empty;
    Layout = null;
}
<div class="wrapper menuWrapper">
    <div class="mainMenuOuterDiv">
        <div class="mainMenu">
            <ul class="menuMainHeaders">
                <li class="menuFirstHeader menuMainHeader"><a class="menuMainHeaderLink" href="./">
                    <img alt ="" src="@Url.Content("~/content/themes/default/img/menu/menuHome.png")"/></a>
                </li>
                @foreach (var mn in Model.Where(r => r.ParentId == null && r.IsHomePage == false && r.ShowInMenu == true && r.DraftSourcePageId <= 0 && r.IsPublished == true))
                {

                    menuBoardCss = string.Format("{0}_{1}", "menuborder", mn.Name.Replace("-", string.Empty).ToLowerInvariant());
                    if (cnt == 1)
                    {
                        cssclass = "menuMainHeader menuMainHeader2";
                    }
                    else
                    {
                        cssclass = "menuMainHeader";
                    }
                    
                    if (cnt == Model.Count())
                    {
                        linkCss = " lastLiNoBgWithM argin menuMainHeaderLink";
                    }
                    <li class="@cssclass @menuBoardCss"><a class="@linkCss" href="@mn.Name">@mn.Title</a>
                    @if (Model.Where(r => r.ParentId == mn.Id && r.IsPublished == true && r.ShowInMenu == true && r.DraftSourcePageId <= 0).Count() > 0)
                    {
                        ViewBag.ParentPage = mn.Id;
                        @Html.Partial("TopSubMenu", Model)
                    }
                    </li>
                    cnt++;
                }
            </ul>
            <div class="menuPhoneDiv">
                <img src="@Url.Content("~/content/themes/default/img/menu/menuPhoneIcon.png")" alt=""/>
                <span>@("+00 (000) 000 00 00".Label("SitePhone"))</span>
            </div>
        </div>
        <!--mainMenu END -->
    </div>
    <!--mainMenuOuterDiv END -->
</div>
